/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
	
	function converteMaiusculo(obj) {
            obj.value = obj.value.toUpperCase();
    }

	function carregarTpEquip(id){

		var cod = 'cod'+id;
		var ds = 'ds'+id;
		var en = 'en' + id;

		setar(en,'txtEnd');
		setar(ds,'txtDescr');
		setar(cod,'txtCod');

		var mo = 'mo'+id;
		var tp = 'tp'+id;
		var pu = 'pu'+id;

		changeSelect(mo,"selModelo");
		changeSelect(tp,"selTipoEquip");
		changeSelect(pu,"SelPerfilUtil");


	}

	function setar(valor,elemento){
		var lg = document.getElementById(valor).innerHTML;
		document.getElementById(elemento).value = lg;
	}

	function selecionarBox(valor,elemento){
		var lg = document.getElementById(valor).innerHTML;
		//alert(lg);
		//document.getElementById(elemento).setAttribute("selected",'selected');
	}

	function excluirRegistro(url) {
		if (confirm("Confirmar Exclusao?"))
			location.href = url ;
	}

	function setaFoco(element){
		window.document.getElementById(element).focus();
	}

        function setaFocoLimpa(element){
		window.document.getElementById(element).value = "";
                window.document.getElementById(element).focus();
	}


    function changeSelect(value,select){
    	value = document.getElementById(value).innerHTML;
        var el = document.getElementById(select).getElementsByTagName("option");
        for(i=0;i<el.length;i++){
            if(el[i].text ==value){
               el[i].selected=true;
            }
        }
    }


